#ifndef _SENSOR_H_
#define _SENSOR_H_

#include <QtGui/QFrame>

#include "../robotmap/robotmap.h"
#include "../robot/robot.h"

enum PluginType {
	SENSOR, ACTUATOR
};

class PluginDef {
public :
	PluginType pluginType ;
	std::string className ;
	std::string classDescription ;
	PluginDef(PluginType pT, const std::string cN, const std::string cD) : 
		pluginType(pT), className(cN), classDescription(cD) {}
};

class Sensor {
protected :
	const RobotMap* _map ;
	const Robot* _robot ;
	QFrame* _statusPanel ;
public :
	Sensor(const RobotMap* map = 0 , const Robot* robot = 0) :
		_map(map), _robot(robot), _statusPanel(0) {}
	virtual ~Sensor() {}
	
	const Robot* robot() const { return _robot ; }
	const RobotMap* map() const { return _map ; }
	
	void setRobotMap(RobotMap* robotmap) { _map = robotmap ; }
	void setRobot(Robot* robot) { _robot = robot ; }
	
	virtual int firstValue() = 0 ;
	virtual int secondValue() { return 0 ; }
	virtual int thirdValue() { return 0 ; }
	virtual int fourthValue() { return 0 ; }
	virtual int fifthValue() { return 0 ; }
	
	virtual void updateDatas() = 0 ;
	
	virtual void updateStatusPanel() { }
	QWidget* statusPanel() const { return _statusPanel ; }
};

#endif // _SENSOR_H_